<!DOCTYPE html>
<html>
<head>
    <title>公益活动表</title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
	<div v-show="showList">
        <Row :gutter="16">
            <i-col span="4">
                <i-input v-model="q.name" @on-enter="query" placeholder="名称"/>
            </i-col>
            <i-button @click="query">查询</i-button>
            <i-button type="warning" @click="openRecord"><i class="fa fa-pencil-square-o"></i>&nbsp;捐赠记录</i-button>
            <div class="buttons-group">
                #if($shiro.hasPermission("commonweal:save"))
                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
                #if($shiro.hasPermission("commonweal:update"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                #end
                #if($shiro.hasPermission("commonweal:delete"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end
            </div>
        </Row>
	    <table id="jqGrid"></table>
	    <div id="jqGridPager"></div>
    </div>

    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
		<i-form ref="formValidate" :model="commonweal" :rules="ruleValidate" :label-width="80">
            <Form-item label="活动名称" prop="title">
                <i-input v-model="commonweal.title" placeholder="公益活动名称"/>
            </Form-item>
            <Form-item label="活动简要" prop="brief">
                <i-input v-model="commonweal.brief" placeholder="活动简要"/>
            </Form-item>
            <Form-item label="列表封面图" prop="listCoverUrl">
                <i-col span="16">
                    <i-input v-model="commonweal.listCoverUrl" placeholder="列表封面图" readonly/>
                </i-col>
                <i-col span="3">
                    <Form-item :label-width="1">
                        <Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"
                                max-size="2048"
                                :on-success="handleSuccessPicUrl" :on-format-error="handleFormatError"
                                :show-upload-list="false"
                                :on-exceeded-size="handleMaxSize">
                            <i-button icon="ios-cloud-upload-outline">上传图片</i-button>
                        </Upload>
                    </Form-item>
                </i-col>
                <i-col span="3">
                    <Form-item :label-width="1">
                        <i-button icon="eye" @click="eyeImagePicUrl">预览图片</i-button>
                    </Form-item>
                </i-col>
            </Form-item>
            <Form-item label="内容封面图" prop="coverUrl">
                <i-col span="16">
                    <i-input v-model="commonweal.coverUrl" placeholder="内容封面图" readonly/>
                </i-col>
                <i-col span="3">
                    <Form-item :label-width="1">
                        <Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"
                                max-size="2048"
                                :on-success="handleSuccessPicUrl2" :on-format-error="handleFormatError"
                                :show-upload-list="false"
                                :on-exceeded-size="handleMaxSize">
                            <i-button icon="ios-cloud-upload-outline">上传图片</i-button>
                        </Upload>
                    </Form-item>
                </i-col>
                <i-col span="3">
                    <Form-item :label-width="1">
                        <i-button icon="eye" @click="eyeImagePicUrl2">预览图片</i-button>
                    </Form-item>
                </i-col>
            </Form-item>
            <Form-item label="发起者" prop="organizer">
                <i-input v-model="commonweal.organizer" placeholder="发起与善款接收机构"/>
            </Form-item>
            <Form-item label="项目说明" prop="contentDesc">
                <div id="contentDesc"></div>
            </Form-item>
            <Form-item label="项目计划" prop="projectPlan">
                <div id="projectPlan"></div>
            </Form-item>
            <Form-item label="受益对象" prop="beneficiary">
                <i-input type="textarea" :rows="4" v-model="commonweal.beneficiary" placeholder="受益对象"/>
            </Form-item>
            <Form-item label="项目预算" prop="projectBudget">
                <!--<i-input v-model="commonweal.projectBudget" placeholder="项目预算"/>-->
                <div id="projectBudget"></div>
            </Form-item>
            <Form-item label="标签" prop="tags">
                <i-input v-model="commonweal.tags" placeholder="标签（多个请使用英文逗号隔开）"/>
            </Form-item>
            <!--<Form-item label="是否热门" prop="isHot">-->
                <!--<Radio-group v-model="commonweal.isHot">-->
                    <!--<Radio label="1">-->
                        <!--<span>是</span></Radio>-->
                    <!--<Radio label="0">-->
                        <!--<span>否</span></Radio>-->
                <!--</Radio-group>-->
            <!--</Form-item>-->
            <Form-item label="是否已结束" prop="isExpired">
                <Radio-group v-model="commonweal.isExpired">
                    <Radio label="1">
                        <span>是</span></Radio>
                    <Radio label="0">
                        <span>否</span></Radio>
                </Radio-group>
            </Form-item>
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>
                <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
	</Card>
</div>

<script src="${rc.contextPath}/js/shop/commonweal.js?_${date.systemTime}"></script>
</body>
</html>